package com.lantosec.hmrp.modules.form.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;

import com.lantosec.hmrp.core.mvc.BaseEntity;
import com.lantosec.hmrp.modules.form.vo.FormTempDataVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;

/**
 * <p>
 * 流程表单数据临时保存表 实体类
 * </p>
 *
 * @author AutoCode
 * @since 2020-05-27
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("form_temp_data")
public class FormTempData extends BaseEntity<FormTempDataVO> {

    private static final long serialVersionUID = 1L;
    public FormTempData(FormTempDataVO vo){
        this.tempDataId = vo.getTempDataId();
        this.userId = vo.getUserId();
        this.procdefId = vo.getProcdefId();
        this.taskId = vo.getTaskId();
        this.layoutId = vo.getLayoutId();
        this.formData = vo.getFormData();
        this.auditStatus = vo.getAuditStatus();
        this.comment = vo.getComment();
        this.createTime = vo.getCreateTime();
    }

    @Override
    public FormTempDataVO convertToVO(){
        return new FormTempDataVO(this);
    }


    /**
     * 主键记录ID
     */
    @TableId(value = "temp_data_id", type = IdType.ASSIGN_UUID)
    private String tempDataId;

    /**
     * 用户Id
     */
    private String userId;

    /**
     * Flowable流程定义ID
     */
    private String procdefId;

    /**
     * Flowable流程任务Id
     */
    private String taskId;

    /**
     * 表单布局Id
     */
    private String layoutId;

    /**
     * 表单数据
     */
    private String formData;

    /**
     * 审核状态 0 不通过，1 通过
     */
    private Integer auditStatus;

    /**
     * 审核意见
     */
    private String comment;

    /**
     * 创建时间
     */
    private Date createTime;


    public enum ColName {
        temp_data_id, user_id, procdef_id, task_id, layout_id, form_data, audit_status, comment, create_time,
    }
}
